import { InputType, Field, ObjectType, PartialType } from '@nestjs/graphql';
import { BaseCreateSchema, PageInput, PaginatedResponse } from 'src/common/mongodb/commonSchema';
import { GraphQLBigInt } from 'graphql-scalars';
import { Activity } from '../entities/activity.entity';
import { MongoQueryScalar } from 'src/common/scalars/mongo.query.scalar';

@InputType()
export class CreateActivityInput extends BaseCreateSchema {
  @Field(() => String)
  name: string;

  @Field(() => [GraphQLBigInt], { description: '用户列表' })
  users: number[];
}

@InputType()
export class UpdateActivityInput extends PartialType(CreateActivityInput) {
  @Field(() => GraphQLBigInt)
  id: number;
}

@InputType()
export class SearchActivityInput {
  @Field(() => GraphQLBigInt, { nullable: true }) _id: number;

  @Field(() => MongoQueryScalar, { nullable: true }) name: string;
}

@InputType()
export class PageActivityInput extends PageInput<SearchActivityInput>(SearchActivityInput) {
}

@ObjectType()
export class PageActivityResponse extends PaginatedResponse<Activity>(Activity) {
}



